package com.ldz.elastic;

import com.dangdang.ddframe.job.lite.internal.schedule.JobRegistry;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: ldz
 * @Date: 2018-05-15 18:11
 */
@RestController
@RequestMapping("/jobs")
public class JobController {

    @RequestMapping("/{jobName}/shutdown")
    public String shutdown(@PathVariable("jobName") String jobName) {
        JobRegistry.getInstance().shutdown(jobName);
        return "success";
    }

}
